package com.jigu.movie.config;

import com.jigu.movie.annotation.ExcludeFromComponentScan;
import com.netflix.client.config.IClientConfig;
import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 自定义eureka的策略 不能放到SpringbootApplication 相关能被@ComponentScan扫到会被RibbonClients覆盖
 */
@Configuration
//@RibbonClient(name = "user-service",configuration = TestConfiguration.class)
@ExcludeFromComponentScan
public class TestConfiguration {

    @Bean
    public IRule ribbonRule(){
        return new RandomRule();
    }

}
